<?php
    // +----------------------------------------------------------------------
    // | 用户私信聊天记录
    // +----------------------------------------------------------------------
    // | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
    // +----------------------------------------------------------------------
    // | Author: 微尘 <yicmf@qq.com>
    // +----------------------------------------------------------------------
    namespace app\model\ucenter;

    use app\model\app\Device;
    use app\model\cms\Document;
    use app\model\ucenter\User;

    class Label extends Common
    {


        public function users()
        {
            return $this->belongsToMany(User::class, UserTag::class);
        }

        public function group()
        {
            return $this->belongsTo(LabelGroup::class);
        }

        /**
         * 写入修改
         * @param $data
         */
        public static function onBeforeInsert($data)
        {
            $data['status'] = 1;
        }
    }
